import Vue from 'vue';
import Vuex from 'vuex';
import student from './modules/student';
Vue.use(Vuex);

const store = new Vuex.Store({
    modules:{
        student
    },
    state: {
        count: 100
    },
    getters:{
        computeCount(state){
            return '$' + state.count;
        }
    },
    mutations: {
        increment(state, count){
            state.count += count;
        }
    },
    actions: {
        delayIncrement(context,count){
            setTimeout(() => {
                context.commit('increment',count);
            },1000);
        }
    }
});
export default store;